package com.sxhalo.fsms;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;

import com.sxhalo.fsms.service.SysSettingsService;

@MapperScan("com.sxhalo.fsms.mapper")
@SpringBootApplication
@EnableScheduling
@EnableCaching
public class Application implements CommandLineRunner {

	public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

	@Override
	public void run(String... args) throws Exception {

	}

	@Autowired
	private SysSettingsService cronServ;

	@Bean
	public String getCronValue()
	{
	    return cronServ.getStringValue("cron_value");
	}
}
